package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.RecheckingRuleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 重复规则Dao层
 * @author yanglei
 * @date 2022/11/7 16:52
 */
@Mapper
public interface RecheckingRuleDao {

    Integer insert(RecheckingRuleEntity recheckingRule);

    void insertBatch(@Param("list") List<RecheckingRuleEntity> list);

    void insertBatchByScript(@Param("list") List<RecheckingRuleEntity> list);

    Integer update(RecheckingRuleEntity recheckingRule);

    void updateBatch(@Param("list") List<RecheckingRuleEntity> list,@Param("corpid") String corpid);


    List<RecheckingRuleEntity> findEntities(@Param("param")Map<String,Object> param);

    RecheckingRuleEntity getByKey(@Param("corpid") String corpid , @Param("key") Long id);

    RecheckingRuleEntity getRuleByFormId(@Param("corpid") String corpid , @Param("formId") Long formId, @Param("businessType") Integer businessType);

    RecheckingRuleEntity getNormalEnable(@Param("corpid") String corpid,  @Param("businessType") Integer businessType);

    List<RecheckingRuleEntity> getByBusinessType(@Param("corpid") String corpid,  @Param("businessType") Integer businessType);

    List<Long> getFormIdListByBusinessType(@Param("corpid") String corpid,  @Param("businessType") Integer businessType);
}
